package com.alipay.sofa.award.endpoint.facade;

import com.alipay.sofa.award.endpoint.constants.RestConstants;
import com.alipay.sofa.award.endpoint.constants.URLConstants;
import com.alipay.sofa.award.endpoint.exception.CommonException;
import com.alipay.sofa.award.endpoint.response.RestSampleFacadeResp;
import com.alipay.sofa.award.record.common.dal.dataobject.AwardRecord;
import com.alipay.sofa.award.record.facade.PagedQueryResult;

import javax.ws.rs.*;

/**
 * AwardRecordsRestFacade
 *
 * @author yangguanchao
 * @since 2018/09/03
 */
@Path(URLConstants.REST_API_PEFFIX + "/award/records")
@Consumes(RestConstants.DEFAULT_CONTENT_TYPE)
@Produces(RestConstants.DEFAULT_CONTENT_TYPE)
public interface AwardRecordsRestFacade {

    /**
     * http://localhost:8341/webapi/award/records
     *
     * @param currentPage page
     * @param pageSize size
     * @return records
     * @throws CommonException exception
     */
    @GET
    @Path("/")
    RestSampleFacadeResp getPagedAwardRecords(@QueryParam("currentPage") @DefaultValue("1") int currentPage,
                                              @QueryParam("pageSize") @DefaultValue("10") int pageSize)
                                                                                                       throws CommonException;

    /**
     * http://localhost:8341/webapi/award/records/self
     *
     * @param userId userId
     * @param currentPage page
     * @param pageSize size
     * @return records
     * @throws CommonException exception
     */
    @GET
    @Path("/self")
    RestSampleFacadeResp<PagedQueryResult<AwardRecord>> getSelfPagedAwardRecords(@HeaderParam("userId") String userId,
                                                                                 @QueryParam("currentPage") @DefaultValue("1") int currentPage,
                                                                                 @QueryParam("pageSize") @DefaultValue("10") int pageSize)
                                                                                                                                          throws CommonException;

}
